﻿@{
    ViewBag.Title = "查看回访记录";
    Layout = "~/Areas/IM/Views/Shared/_Layout.cshtml";
}

@section Scripts{
    <script type="text/javascript">

        $(document).ready(function () {
            RevistAddMainCheckGrid();
        });

        $(window).resize(function () {
            $.setGridOnly("#RevisitOperateCheck", "#RevisitOperateChecklList");
        });

        function RevistAddMainCheckGrid() {
            $('#RevisitOperateChecklList').datagrid({
                width: 'auto',
                height: 'auto',
                fitColumns: true, //真正的自动展开/收缩列的大小，以适应网格的宽度，防止水平滚动。
                loadMsg: '数据加载中,请稍后……',
                url: '@Url.Content("~/DD/Revisit/GetRevistAddDetail")',
                striped: true,
                singleSelect: true,
                //  pagination: false,//不启用分页，默认每页10行
                rownumbers: true,//显示页码，默认 提供 10 - 50 的页容量选择下拉框
                //pageSize: 15,//设置 页容量5
                //pageList: [10, 15, 20],//设置 页容量下拉框
                queryParams: {
                    ID: '@ViewData["RowID"]',
                    ifOperate: '@ViewData["ifOperate"]'
                  
                },
                frozenColumns: [[
                     { field: "ID", hidden: true },
                { field: "TaskCode", hidden: true },
                 {
                     field: "RevisitState", title: "回访状态", width: '5%', align: "center"
                 },
                {
                    field: "RevisitWay", title: "回访方式", width: '5%', align: "center"
                },
                {
                    field: "Satisfaction", title: "满意度", width: '9%', align: "center"
                },
                {
                    field: "NotSatisfactionReson", title: "不满意原因", width: '12%', align: "center"
                }
                ]],

                columns: [[
                { field: "Station", title: "分站", width: '5%', align: "center" },
                { field: "Ambluance", title: "车辆", width: '6%', align: "center" },
                { field: "AlarmTel", title: "呼救电话", width: '7%', align: "center" },
                { field: "LinkCall", title: "联系电话", width: '7%', align: "center" },
                { field: "LinkMan", title: "联系人", width: '5%', align: "center" },
                { field: "LocalAddr", title: "现场地址", width: '12%', align: "center" },
                { field: "PatientName", title: "患者姓名", width: '5%', align: "center" },
                { field: "Sex", title: "性别", width: '3%', align: "center" },
                { field: "Age", title: "年龄", width: '3%', align: "center" },
                { field: "AlarmReason", title: "主诉", width: '7%', align: "center" },
                { field: "SendAddr", title: "送往地址", width: '10%', align: "center" },
                { field: "StartTaskTime", title: "生成任务时刻", width: '10%', align: "center", formatter: $.formatTime },
                { field: "DispatcherName", title: "责任调度员", width: '5%', align: "center" },
                { field: "Driver", title: "司机", width: '5%', align: "center" },
                { field: "Doctor", title: "医生", width: '5%', align: "center" },
                { field: "Stretcher", title: "担架员", width: '5%', align: "center" }
                ]],
                rowStyler: function (index, row) {
                    if (row.RevisitState == "未回访") {
                        return 'background-color:#6293BB;color:#fff;';
                    }
                },
                onLoadSuccess: function (data) {
                    var allRowsData = $("#RevisitOperateChecklList").datagrid("getRows");//
                    if (allRowsData.length == 0) {

                        $.messager.alert('提示', '没有相关已回访记录', 'info', function () {
                            this.window.close();
                        });

                    }
                }



            });
            $.setGridOnly("#RevisitOperateCheck", "#RevisitOperateChecklList");
        }

    </script>
}
<div id="RevisitOperateCheck" data-options="region:'center'" style="background: #fafafa; overflow: hidden">
    <table id="RevisitOperateChecklList" border="0"></table>
</div>